#ifndef MESSAGE_RECEIVER_TEST_H
#define MESSAGE_RECEIVER_TEST_H

#include <gtest/gtest.h>
#include "test_common.h"
#include <memory>

#include <src/message.h>
#include <src/message_receiver.h>
#include <src/port.h>
#include <testing/mocks/message_buffer_mock.h>

class ut_message_receiver : public ::testing::Test
{
protected:
    std::shared_ptr<message_buffer_mock> buffer_mock;
    std::shared_ptr<message_receiver> receiver;

public:
    ut_message_receiver() :
        buffer_mock(new message_buffer_mock()),
        receiver(new message_receiver(buffer_mock))
    {
    }
};

class message_buffer_test : public ::testing::Test
{
};

TEST_F(ut_message_receiver, constructor)
{
	int message_id = 2;
	const char* payload = "abc";
	message::msg_handle msg(new message(message_id, payload, sizeof(payload)));

    port p;
    //message_receiver receiver(buffer_mock);
    //EXPECT_TRUE(p.register_observer(receiver.get()));

    EXPECT_CALL(*buffer_mock, push(msg));

    receiver->receive(msg);
}

#endif // MESSAGE_RECEIVER_TEST_H

